home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / etc_-_Configuration_Files / PCMCIA / IDE < prev    next >
Text File  |  1999-09-17  |  1KB  |  64 lines

  1. #!/bin/sh
  2. #
  3. # ide 1.5 1998/10/08 19:44:18 (David Hinds)
  4. #
  5. # Initialize or shutdown a PCMCIA ATA/IDE adapter
  6. #
  7. # The first argument should be either 'start' or 'stop'.  The second
  8. # argument is the base name for the device.
  9. #
  10. # The script passes an extended device address to 'ide.opts' in the
  11. # ADDRESS variable, to retrieve device-specific configuration options.
  12. # The address format is "scheme,socket,serial_no[,part]" where
  13. # "scheme" is the PCMCIA configuration scheme, "socket" is the socket
  14. # number, "serial_no" is the card's serial number if available, and
  15. # "part" is, optionally, the partition number.
  16. #
  17. # The script first calls ide.opts for the entire device.  If ide.opts
  18. # returns with the PARTS variable set, then this variable contains a
  19. # list of partitions for which options should be read.
  20. #
  21.  
  22. if [ -r ./shared ] ; then . ./shared ; else . /etc/pcmcia/shared ; fi
  23.  
  24. # Get device attributes
  25. get_info $DEVICE
  26. eval `/sbin/ide_info /dev/$DEVICE` || usage
  27.  
  28. # Load site-specific settings
  29. ADDRESS="$SCHEME,$SOCKET,$SERIAL_NO"
  30. . $0.opts
  31.  
  32. case "$ACTION" in
  33.  
  34. 'start')
  35.     add_parts $ADDRESS "$PARTS" || exit 1
  36.     ;;
  37.  
  38. 'check')
  39.     if [ -b /dev/$DEVICE ] ; then
  40.     fuser -s -m /dev/${DEVICE}* && exit 1
  41.     else
  42.     fuser -s /dev/${DEVICE}* && exit 1
  43.     fi
  44.     ;;
  45.  
  46. 'stop')
  47.     rm_parts $ADDRESS "$PARTS" || exit 1
  48.     ;;
  49.  
  50. 'cksum')
  51.     chk_parts "$3,$SOCKET,$SERIAL_NO" || exit 1
  52.     ;;
  53.     
  54. 'suspend'|'resume')
  55.     ;;
  56.  
  57. *)
  58.     usage
  59.     ;;
  60.  
  61. esac
  62.  
  63. exit 0
  64.